/* ===========================================================
   AvianJay Studio — 工作室版型
   顏色取自頭像：鈷藍的門、黃雨傘、淺藍雨衣
   =========================================================== */

:root {
  --paper: #f3f5f7;
  --ink: #14204a;
  --ink-soft: #4d5779;
  --rule: rgba(20, 32, 74, 0.14);
  --cobalt: #2a4fd7;
  --umbrella: #f6d03c;
  --raincoat: #bfe4f0;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --display: 'Huninn', 'Noto Sans TC', system-ui, sans-serif;
  --body: 'Noto Sans TC', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* 避免段落最後一行只剩一兩個字 */
p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 深色底上，焦點框改用雨傘黃才看得到 */
.hero :focus-visible,
.footer :focus-visible {
  outline-color: var(--umbrella);
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ===== 首屏 ===== */
.hero {
  background: var(--cobalt);
  color: var(--paper);
  overflow: hidden;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.nav-mark {
  font-family: var(--display);
  font-size: 1.125rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: clamp(18px, 3vw, 36px);
}

.nav-links a {
  display: block;
  padding-block: 4px;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s var(--ease);
}

.nav-links a:hover {
  border-color: var(--umbrella);
}

/* 直排字佔右欄、跨過標題到按鈕三列 */
.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title vert"
    "lede vert"
    "actions vert";
  column-gap: clamp(16px, 4vw, 64px);
  padding-top: clamp(40px, 8vw, 104px);
  padding-bottom: clamp(56px, 9vw, 120px);
}

/* 中文句子只在片語之間換行，不會把「每天」「招呼」拆成兩行 */
.phrase {
  display: inline-block;
  max-width: 100%;
}

.hero-title {
  grid-area: title;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 11.5vw, 9.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero-line {
  display: block;
}

.hero-lede {
  grid-area: lede;
  max-width: 26em;
  margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(1.0625rem, 1.7vw, 1.3125rem);
  line-height: 1.75;
  color: rgba(243, 245, 247, 0.88);
}

.hero-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-inline: 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-solid {
  background: var(--umbrella);
  color: var(--ink);
}

.btn-solid:hover {
  background: #ffe169;
}

.btn-line {
  color: var(--paper);
  box-shadow: inset 0 0 0 2px rgba(243, 245, 247, 0.5);
}

.btn-line:hover {
  box-shadow: inset 0 0 0 2px var(--paper);
}

/* 直排「工作室」：整個首屏唯一的大裝飾 */
.hero-vert {
  grid-area: vert;
  align-self: end;
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-size: clamp(4rem, 12.5vw, 10.5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--umbrella);
  user-select: none;
}

/* ===== 一般區塊 ===== */
.section {
  padding-block: clamp(72px, 10vw, 136px);
}

.section + .section {
  padding-top: 0;
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.15;
}

.section-lede {
  max-width: 34em;
  margin-top: 10px;
  color: var(--ink-soft);
}

/* 作品跟小工具共用的清單：上方粗線，項目之間細線 */
.rows {
  list-style: none;
  margin-top: clamp(32px, 4vw, 56px);
  border-top: 2px solid var(--ink);
}

.rows > li {
  border-bottom: 1px solid var(--rule);
}

.link {
  font-weight: 500;
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(42, 79, 215, 0.35);
  transition: text-decoration-color 0.2s var(--ease);
}

.link:hover {
  text-decoration-color: var(--cobalt);
}

/* ===== 作品 ===== */
.work {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px 56px;
  padding-block: clamp(32px, 4.5vw, 56px);
}

.work-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
}

/* 每個作品自己的顏色，像用螢光筆畫過名字 */
.work-name span {
  padding-inline: 0.06em;
  background: linear-gradient(transparent 58%, var(--tone) 58%, var(--tone) 90%, transparent 90%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.work-kind {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.work-body {
  max-width: 36em;
}

.work-pitch {
  margin-bottom: 10px;
  font-weight: 500;
  font-size: 1.3125rem;
  line-height: 1.6;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 18px;
}

/* ===== 小工具 ===== */
.tool {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 2fr);
  align-items: baseline;
  gap: 4px 32px;
  padding-block: 22px;
  text-decoration: none;
}

.tool-name {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tool-desc {
  color: var(--ink-soft);
}

.tool-host {
  justify-self: end;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.tool:hover .tool-name {
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.tools-more {
  margin-top: 28px;
}

/* ===== 關於 ===== */
.about {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 2fr);
  gap: 32px 56px;
  align-items: start;
}

.about-text {
  max-width: 34em;
}

.about-lead {
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.6;
}

.about-text p:not(.about-lead) {
  color: var(--ink-soft);
}

.member {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.portrait {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.portrait img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--raincoat);
}

/* 點頭像才會冒出來的「呱」 */
.croak-bubble {
  position: absolute;
  top: -10px;
  right: -18px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--umbrella);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.125rem;
  line-height: 1.6;
  opacity: 0;
  pointer-events: none;
}

.croak-bubble.is-on {
  opacity: 1;
}

.member figcaption {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.member-name {
  font-weight: 700;
}

.member-role {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ===== 聯絡 ===== */
.contact {
  background: var(--umbrella);
  color: var(--ink);
  padding-block: clamp(72px, 10vw, 136px);
}

.contact :focus-visible {
  outline-color: var(--ink);
}

.contact-title {
  max-width: 15em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  line-height: 1.4;
}

.contact-big {
  display: inline-block;
  margin-top: clamp(20px, 3vw, 32px);
  font-family: var(--display);
  font-size: clamp(2.5rem, 8.5vw, 6.5rem);
  line-height: 1.15;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  text-decoration-color: var(--cobalt);
  transition: color 0.2s var(--ease);
}

.contact-big:hover {
  color: var(--cobalt);
}

.contact-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.contact-list a {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  text-decoration: none;
}

.contact-k {
  font-weight: 700;
}

.contact-v {
  font-size: 0.9375rem;
  color: rgba(20, 32, 74, 0.72);
}

.contact-list a:hover .contact-v {
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== 頁尾 ===== */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: 44px 36px;
  font-size: 0.9375rem;
}

.friends {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.friends-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.25rem;
}

.friend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(243, 245, 247, 0.78);
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.friend:hover {
  color: var(--paper);
}

.friend-banner img {
  width: auto;
  height: 36px;
  border-radius: 4px;
}

.friend-banner:hover img {
  opacity: 0.85;
}

/* 圖掛掉時 onerror 會移除 <img>，備援文字變成第一個子元素才顯示 */
.friend-alt {
  display: none;
}

.friend-banner > .friend-alt:first-child {
  display: inline;
}

.friend-face {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(243, 245, 247, 0.14);
  color: rgba(243, 245, 247, 0.6);
}

/* ===== 平板 ===== */
@media (max-width: 860px) {
  .work {
    grid-template-columns: 1fr;
  }

  .about {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .about .section-title {
    grid-column: 1 / -1;
  }
}

/* ===== 手機 ===== */
@media (max-width: 600px) {
  .nav-mark {
    display: none;
  }

  .nav {
    justify-content: flex-end;
  }

  /* 窄螢幕：直排字只陪著標題和說明，按鈕拿回整排寬度 */
  .hero-body {
    grid-template-areas:
      "title vert"
      "lede vert"
      "actions actions";
    column-gap: 12px;
  }

  .hero-title {
    font-size: clamp(3rem, 15vw, 4rem);
  }

  .hero-vert {
    align-self: start;
    font-size: clamp(3.75rem, 17vw, 4.75rem);
  }

  .tool {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 18px;
  }

  .tool-desc {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .tool-host {
    grid-column: 2;
    grid-row: 1;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .member {
    justify-self: start;
    flex-direction: row;
    text-align: left;
    gap: 18px;
  }

  .portrait img {
    width: 88px;
    height: 88px;
  }

  .contact-list {
    gap: 16px 32px;
  }
}

/* ===== 動畫關掉時，一切照常顯示 ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}
