/* doinsane 官網｜依 Figma「Layout 0626 / A-2」切版。設計寬 1440。 */

:root {
  --c-abyss: #06141f;
  --c-surface: #5081a8;
  --c-shallow: #35658c;
  --c-ice: #8de7ff;
  --c-ice-80: rgba(141, 231, 255, .8);
  --c-spark: #fffc88;
  --c-text: #fff;
  --c-text-2: #e6e6e6;
  --c-text-3: #ccc;

  --f-display: "Bebas Neue", "Noto Sans TC", sans-serif;
  --f-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --f-latin: "Montserrat", "Noto Sans TC", sans-serif;

  --pad-l: 130px;      /* 標題離左邊 */
  --pad-r: 90px;
  --rail-x: 82px;      /* 深度尺的線 */
  --header-h: 70px;
  --u: calc(100vw / 1440); /* 1 設計 px */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--c-abyss);
  color: var(--c-text);
  font-family: var(--f-body);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--c-ice); color: var(--c-abyss); padding: 8px 16px; border-radius: 4px;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--c-ice); outline-offset: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-r);
  transition: background-color .4s, backdrop-filter .4s;
}
.site-header.is-scrolled { background: rgba(6, 20, 31, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.site-header__logo img { width: 149px; filter: drop-shadow(0 0 6px rgba(0, 0, 0, .25)); }
.site-nav { display: flex; align-items: center; gap: 70px; }
.site-nav a {
  font-size: 16px; letter-spacing: 4px; text-decoration: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, .5);
  transition: color .2s;
}
.site-nav a:hover { color: var(--c-ice); }
.site-nav__lang { display: flex; align-items: center; gap: 6px; }
.site-nav__lang img { width: 27px; height: 27px; }
.site-nav__lang-text { display: none; }
.site-header__toggle { display: none; }

/* ---------- Depth rail（左側深度尺） ---------- */
.section { position: relative; }
.depth {
  position: absolute; left: calc(var(--rail-x) - 37px); top: 0; bottom: 0; width: 41px;
  pointer-events: none;
}
.depth::before { /* 垂直線 */
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .6) 20%, rgba(255, 255, 255, .6));
}
.depth::after { /* 圓點 */
  content: ""; position: absolute; right: -3.5px; top: calc(var(--depth-y, 275px) - 4px);
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 10px rgba(141, 231, 255, .9);
}
.depth__name, .depth__m {
  position: absolute; right: 16px; text-align: right; white-space: nowrap;
}
.depth__name {
  top: calc(var(--depth-y, 275px) - 30px);
  font: 10px/1.2 var(--f-display); letter-spacing: .5px; opacity: .8;
}
.depth__m { top: calc(var(--depth-y, 275px) + 2px); font: 8px/1 var(--f-latin); color: var(--c-text-2); letter-spacing: .4px; }
.depth__m small { font-size: 6px; }

/* ---------- Section title ---------- */
.section__title h2 { font-family: var(--f-display); font-weight: 400; letter-spacing: 1.6px; line-height: 56px; text-transform: uppercase; }
.section__title h2 span { display: block; }
.t-sm { font-size: 50px; }
.t-lg { font-size: 60px; }
.section__sub { margin-top: 18px; font-size: 18px; line-height: 25px; letter-spacing: 1.8px; color: var(--c-text-2); }
.lang-en .section__sub { font-family: var(--f-latin); font-size: 16px; letter-spacing: 1px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; z-index: 2;
  height: max(560px, min(100svh, 56vw + 40px));
  overflow: hidden;
  background: var(--c-surface);
}
.hero__sky, .hero__snow {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}
.hero__snow { mix-blend-mode: screen; animation: snow-drift 24s linear infinite alternate; }
@keyframes snow-drift { from { transform: translateY(-1.5%) scale(1.04); } to { transform: translateY(1.5%) scale(1.04); } }
.hero__stage {
  /* 1440×766 的設計畫框，貼齊底部、水平置中；手機放大裁掉兩側天空 */
  --w: max(100vw, min(100svh * 1440 / 766, 140vw));
  position: absolute; left: 50%; bottom: 0;
  width: var(--w); aspect-ratio: 1440 / 766;
  transform: translateX(-50%);
}
.hero__stage > * { position: absolute; will-change: transform; }
.hero__word--doin { left: calc(308 / 1440 * 100%); top: calc(328 / 766 * 100%); width: calc(394 / 1440 * 100%); }
.hero__word--sane { left: calc(702 / 1440 * 100%); top: calc(328 / 766 * 100%); width: calc(426 / 1440 * 100%); }
.hero__mountain { left: calc(269 / 1440 * 100%); top: calc(403 / 766 * 100%); width: calc(882 / 1440 * 100%); }
.hero__scroll {
  position: absolute; z-index: 3; left: 50%; bottom: 34px; width: 92px; margin-left: -46px;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(8px); } }

/* ---------- Deep（服務＋合作夥伴共用背景） ---------- */
.deep {
  position: relative; z-index: 1;
  --u: calc(100vw / 1440);
  background: linear-gradient(to bottom, var(--c-surface) 0%, var(--c-shallow) 8.17%, var(--c-abyss) 80.29%);
  overflow: hidden;
}
.deep__bg { position: absolute; inset: 0; pointer-events: none; }
.deep__layer { position: absolute; max-width: none; }
/* 座標換算：設計 top − 727（deep 起點），x 以 720 為中心 */
.deep__layer--l1 { left: calc(50% - 695 * var(--u)); top: calc(-8 * var(--u)); width: calc(1416 * var(--u)); mix-blend-mode: lighten; opacity: .5; }
.deep__layer--l2 { left: calc(50% - 720 * var(--u)); top: calc(4 * var(--u)); width: calc(1440 * var(--u)); mix-blend-mode: screen; opacity: .85; }
.deep__layer--l3 { left: calc(50% - 720 * var(--u)); top: calc(189 * var(--u)); width: calc(1440 * var(--u)); mix-blend-mode: hard-light; opacity: .75; }
.deep__layer--l4 { left: calc(50% - 633 * var(--u)); top: calc(-93 * var(--u)); width: calc(2055 * var(--u)); opacity: .65; }
.deep__under { left: calc(50% - 463 * var(--u)); top: calc(-51 * var(--u)); width: calc(948 * var(--u)); }

.tagline {
  position: relative; padding: calc(126 * var(--u)) 24px 0; text-align: center;
  font: 36px/50px var(--f-display); letter-spacing: 3.6px; text-transform: uppercase;
  text-shadow: 0 0 12px rgba(6, 20, 31, .6);
}

/* ---------- Services ---------- */
.services {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 140px var(--pad-r) 125px var(--pad-l);
  --depth-y: 140px;
}
.services .section__title { width: 236px; flex: none; }
.services__list { flex: 1; max-width: 984px; display: flex; flex-direction: column; }
.service { width: 340px; max-width: 100%; }
.service h3 { font: 48px/1.2 var(--f-display); font-weight: 400; letter-spacing: 2.4px; color: var(--c-ice-80); text-transform: uppercase; }
.service p { margin-top: 12px; font-size: 16px; line-height: 28px; letter-spacing: 1.28px; text-shadow: 0 0 10px rgba(6, 20, 31, .5); }
.lang-en .service p { font-family: var(--f-latin); font-size: 15px; letter-spacing: .3px; }
.service--1 { margin-left: 46.85%; }
.service--2 { margin-left: 7.7%; margin-top: 12px; }
.service--3 { margin-left: 46.85%; margin-top: 8px; }
.service--4 { margin-left: -2%; margin-top: 39px; }

/* ---------- Partners ---------- */
.partners {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 40px;
  padding: 250px var(--pad-r) 400px var(--pad-l);
  min-height: 1021px;
}
.partners .section__title { width: 236px; flex: none; position: relative; z-index: 1; }
.partners__logos { position: relative; z-index: 1; width: 721px; flex: 0 1 721px; }
.partners__diver { position: absolute; left: calc(189 / 1440 * 100%); top: 394px; width: calc(353 / 1440 * 100%); opacity: .9; }
.partners__whale { position: absolute; left: calc(365 / 1440 * 100%); top: 469px; width: calc(970 / 1440 * 100%); }

/* ---------- Work ---------- */
.work {
  background: var(--c-abyss);
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 250px 75px 200px var(--pad-l);
  min-height: 1056px; overflow: hidden;
}
.work__swarm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.work__intro { position: relative; z-index: 1; width: 300px; flex: none; }
.work__body { margin-top: 80px; font: 14px/24px var(--f-latin); letter-spacing: .98px; color: var(--c-text-3); }
.lang-zh-Hant .work__body { font-family: var(--f-body); font-size: 15px; letter-spacing: 1.2px; line-height: 28px; }
.work__jellies { position: relative; z-index: 1; width: 737px; height: 606px; flex: 0 1 737px; }
.jelly {
  position: absolute; width: 450px; height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  text-align: center;
}
.jelly--video { left: 287px; top: 0; animation: float 7s ease-in-out infinite; }
.jelly--website { left: 0; top: 286px; animation: float 8s ease-in-out -3s infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }
.jelly__body { /* 程式畫的月亮水母：傘中心對準光點 */
  position: absolute; left: 50%; top: 50%; width: 340px; max-width: none; height: auto;
  margin: -164px 0 0 -170px; pointer-events: none;
}
.jelly--video .jelly__body { transform: rotate(8deg); }
.jelly--website .jelly__body { transform: rotate(-12deg); }
.jelly__dot { position: relative; width: 46px; height: 46px; margin: -15px; }
.jelly__label { position: relative; font: 42px/1 var(--f-display); letter-spacing: 2.1px; text-transform: uppercase; text-shadow: 0 0 12px rgba(0, 0, 0, .6); }
.jelly__desc { position: relative; margin-top: -12px; font-size: 14px; letter-spacing: 1.4px; color: var(--c-text-2); }

/* ---------- Contact ---------- */
.contact {
  background: var(--c-abyss);
  display: flex; flex-direction: column; align-items: center; gap: 48px;
  padding: 120px 24px 160px;
  min-height: 1159px; overflow: hidden;
}
.contact__sonar { position: absolute; left: 50%; top: 35px; width: 1260px; max-width: none; transform: translateX(-50%); mix-blend-mode: color-dodge; pointer-events: none; animation: sonar 6s ease-in-out infinite; }
@keyframes sonar { 50% { opacity: .6; transform: translateX(-50%) scale(1.02); } }
.contact__fade { position: absolute; left: 50%; top: 35px; width: 1280px; height: 1234px; transform: translateX(-50%); background: linear-gradient(186deg, rgba(6, 20, 31, 0) 17%, var(--c-abyss) 61%); pointer-events: none; }
.contact__title {
  position: relative; text-align: center; text-transform: uppercase;
  font: 113px/135px var(--f-display); letter-spacing: 7.91px;
  background: linear-gradient(246deg, #fff 6.5%, #b6f8ff 53.5%, #fff 73.6%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, .8));
}
.contact__sub { position: relative; font-size: 16px; letter-spacing: 1.6px; color: var(--c-text-2); text-align: center; }
.contact__btn { position: relative; width: 160px; height: 160px; display: grid; place-items: center; text-decoration: none; }
.contact__btn img { position: absolute; inset: -35px; width: 230px; height: 230px; max-width: none; transition: transform .4s, filter .4s; }
.contact__btn span { position: relative; font: 24px/1 var(--f-display); letter-spacing: 1.68px; text-transform: uppercase; text-shadow: 0 0 7px rgba(26, 46, 76, .6); }
.contact__btn:hover img, .contact__btn:focus-visible img { transform: scale(1.08); filter: brightness(1.15); }
.contact__whale { position: absolute; left: calc(50% + 146px); top: 668px; width: 361px; pointer-events: none; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; background: var(--c-abyss);
  display: flex; align-items: center; justify-content: center; gap: 180px;
  padding: 70px 180px;
  box-shadow: 0 -4px 10px rgba(141, 231, 255, .2);
  font-family: var(--f-latin); font-weight: 500;
}
.site-footer__logo { width: 200px; }
.site-footer__name { font-size: 16px; line-height: 24px; letter-spacing: 1.92px; }
.site-footer__contact { margin-top: 15px; font-size: 12px; line-height: 21px; letter-spacing: 1.44px; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.site-footer__contact a { text-decoration: none; }
.site-footer__contact a:hover { color: var(--c-ice); }
.site-footer__copy { margin-top: 10px; font-size: 11px; letter-spacing: 1px; color: var(--c-text-3); }

/* ---------- Reveal 動畫 ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__snow, .hero__scroll, .jelly, .contact__sonar { animation: none; }
}

/* =========================================================
   RWD
   ========================================================= */
@media (max-width: 1279px) {
  :root { --pad-l: 110px; --pad-r: 48px; }
  .site-nav { gap: 44px; }
  .service h3 { font-size: 42px; }
  .services .section__title, .partners .section__title { width: 210px; }
  .work__jellies { transform: scale(.85); transform-origin: right top; }
}

@media (max-width: 1023px) {
  :root { --pad-l: 96px; --pad-r: 32px; }
  .services { flex-direction: column; gap: 56px; }
  .services__list { max-width: none; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 56px 40px; }
  .service { margin: 0 !important; width: auto; }
  .partners { flex-direction: column; min-height: 0; padding-top: 160px; padding-bottom: 360px; }
  .partners__logos { width: 100%; flex: none; }
  .partners__diver { top: auto; bottom: 230px; left: 4%; width: 30%; }
  .partners__whale { top: auto; bottom: 20px; left: 20%; width: 78%; }
  .work { flex-direction: column; padding: 160px 32px 140px var(--pad-l); min-height: 0; }
  .work__intro { width: 100%; max-width: 480px; }
  .work__jellies { transform: none; align-self: center; width: 100%; max-width: 600px; height: auto; flex: none; display: grid; grid-template-columns: 1fr 1fr; margin-top: 40px; }
  .jelly { position: relative; left: auto !important; top: auto !important; width: auto; height: 260px; }
  .jelly--website { margin-top: 120px; }
  .contact__title { font-size: 90px; line-height: 108px; }
  .contact__whale { left: auto; right: 4%; top: auto; bottom: 120px; width: 260px; }
  .site-footer { gap: 80px; padding: 60px 40px; }
}

@media (max-width: 767px) {
  :root { --pad-l: 48px; --pad-r: 20px; --header-h: 60px; }
  .site-header { padding: 0 16px; }
  .site-header__logo img { width: 120px; }
  .site-header__toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    width: 44px; height: 44px; padding: 0 10px; margin-right: -10px;
    background: none; border: 0; cursor: pointer;
  }
  .site-header__toggle > span:not(.visually-hidden) { display: block; height: 1.5px; background: #fff; transition: transform .3s; box-shadow: 0 0 4px rgba(0, 0, 0, .4); }
  .site-header__toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
  .site-header__toggle[aria-expanded="true"] > span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 24px; background: rgba(6, 20, 31, .96);
    visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s, visibility .3s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .site-nav a { padding: 16px 4px; border-bottom: 1px solid rgba(141, 231, 255, .15); font-size: 16px; }
  .site-nav__lang-text { display: inline; letter-spacing: 2px; }
  .site-header.is-open { background: rgba(6, 20, 31, .96); }

  .depth { left: 2px; width: 30px; }
  .depth__name, .depth__m { right: 12px; }

  .hero { height: max(520px, 88svh); }
  .hero__scroll { width: 72px; margin-left: -36px; bottom: 20px; }

  .tagline { font-size: 26px; line-height: 34px; letter-spacing: 2px; padding-top: 90px; padding-left: var(--pad-l); padding-right: var(--pad-r); }
  .deep { --u: calc(100vw / 700); }

  .t-sm { font-size: 40px; }
  .t-lg { font-size: 48px; }
  .section__title h2 { line-height: 46px; }

  .services { padding: 90px var(--pad-r) 100px var(--pad-l); --depth-y: 90px; }
  .services__list { grid-template-columns: 1fr; gap: 40px; }
  .service h3 { font-size: 36px; }
  .service p br { display: none; }

  .partners { padding: 100px var(--pad-r) 260px var(--pad-l); gap: 32px; --depth-y: 100px; }
  .partners__diver { bottom: 170px; width: 42%; }
  .partners__whale { left: 8%; width: 100%; }

  .work { padding: 100px var(--pad-r) 100px var(--pad-l); --depth-y: 100px; }
  .work__body { margin-top: 32px; }
  .work__jellies { grid-template-columns: 1fr; margin-top: 24px; }
  .jelly { height: 200px; }
  .jelly__body { width: 260px; margin: -140px 0 0 -130px; }
  .jelly--website { margin-top: 0; }

  .contact { padding: 100px 20px 140px; min-height: 0; gap: 36px; --depth-y: 100px; }
  .contact__sonar { width: 900px; top: 60px; }
  .contact__fade { width: 100%; height: 100%; top: 0; }
  .contact__title { font-size: 64px; line-height: 74px; letter-spacing: 4px; }
  .contact__whale { width: 180px; bottom: 40px; }

  .site-footer { flex-direction: column; gap: 28px; padding: 48px 20px; text-align: center; }
  .site-footer__contact { justify-content: center; }
}

@media (max-width: 359px) {
  .contact__title { font-size: 54px; line-height: 62px; }
  .t-sm { font-size: 36px; }
  .t-lg { font-size: 42px; }
}
