/* 一之二數位設計 Oneto Digital Design — 共用樣式
   版面樣式大多寫在各頁 HTML 的 style 屬性裡（直接對應設計稿），
   這裡放全站共用、互動狀態與動畫。 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: #111; }
img, svg { max-width: 100%; }
a { color: #111; }
a:hover { color: #555; }

/* 鍵盤焦點 */
:focus-visible { outline: 2px solid #111; outline-offset: 3px; border-radius: 4px; }
footer :focus-visible, section[style*="#111"] :focus-visible { outline-color: #fff; }

/* 跳到主要內容 */
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: #111; color: #fff; padding: 12px 20px; border-radius: 999px;
  text-decoration: none; font-size: 14px; letter-spacing: 0.08em;
}
.skip-link:focus { top: 16px; color: #fff; }

/* 錨點捲動時預留空間 */
[id] { scroll-margin-top: 24px; }

/* ===== 首頁 Hero Logo 動畫 ===== */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mk-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s cubic-bezier(.6,0,.2,1) forwards; }
.mk-d1 { animation-delay: .1s; } .mk-d2 { animation-delay: .5s; } .mk-d3 { animation-delay: .9s; } .mk-d4 { animation-delay: 1.3s; }
.mk-dot { transform-box: fill-box; transform-origin: center; animation: pop .5s 1.9s cubic-bezier(.3,1.6,.5,1) both; }

/* ===== 常見問題（details）===== */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.faq-sign::before { content: "+"; }
details[open] .faq-sign::before { content: "−"; }
.faq-plus { display: inline-block; transition: transform .2s; }
details[open] .faq-plus { transform: rotate(45deg); }

/* ===== 篩選／選項按鈕 ===== */
.chip {
  font-family: inherit; font-size: 15px; letter-spacing: 0.08em;
  padding: 12px 24px; min-height: 44px; border-radius: 999px;
  border: 1.5px solid #111; background: #fff; color: #111; cursor: pointer;
  transition: background .15s, color .15s;
}
.chip:hover { background: #f1f1ef; }
.chip[aria-pressed="true"] { background: #111; color: #fff; }
.chip-check[aria-pressed="true"]::before { content: "✓ "; }

/* 作品卡片 hover */
.work-card > div:first-child { transition: transform .3s ease; }
.work-card:hover > div:first-child { transform: translateY(-4px); }

/* ===== 聯絡表單 ===== */
.f-label { display: block; font-size: 15px; font-weight: 500; letter-spacing: 0.06em; margin: 0 0 10px; }
.f-label small { font-weight: 400; color: #666; font-size: 13px; margin-left: 6px; }
.f-input {
  width: 100%; font-family: inherit; font-size: 16px; color: #111; background: #fff;
  border: 1px solid #c4c4c4; border-radius: 12px; padding: 14px 16px; min-height: 50px;
}
.f-input:focus { outline: 2px solid #111; outline-offset: 1px; border-color: #111; }
textarea.f-input { min-height: 168px; line-height: 1.8; resize: vertical; }
.f-error { margin: 0; font-size: 14px; color: #b00020; }
button[disabled] { opacity: .6; cursor: progress; }

/* ===== 手機選單（漢堡選單）=====
   767px 以下把主選單收進按鈕。只在 JS 啟用時收合，JS 失效時選單照常顯示。 */
.nav-toggle { display: none; }

@media (max-width: 767px) {
  .js .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px;
    width: 48px; height: 48px; margin-right: -10px; padding: 0;
    background: transparent; border: 0; border-radius: 999px; cursor: pointer;
  }
  .nav-toggle-bar { display: block; width: 24px; height: 1.5px; background: #111; transition: transform .25s ease; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  .js .site-nav {
    display: none !important;
    flex-basis: 100%; flex-direction: column; align-items: stretch !important;
    gap: 0 !important; padding: 4px 0 20px; font-size: 18px !important;
  }
  .js .site-nav.is-open { display: flex !important; animation: nav-in .2s ease; }
  .js .site-nav a {
    padding: 18px 0 !important; border: 0 !important; border-bottom: 1px solid #ececec !important;
    border-radius: 0 !important; background: transparent !important; color: #111 !important;
  }
  .js .site-nav a[aria-current="page"] { font-weight: 500; }
  .js .site-nav a[aria-current="page"]::before { content: "● "; font-size: 10px; vertical-align: middle; }
  .js .site-nav a:last-child {
    margin-top: 20px; padding: 16px 0 !important; text-align: center;
    border: 1.5px solid #111 !important; border-radius: 999px !important;
    background: #111 !important; color: #fff !important;
  }
  .js .site-nav a:last-child::before { content: none; }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* 減少動態 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mk-line { animation: none; stroke-dashoffset: 0; }
  .mk-dot { animation: none; }
  .work-card > div:first-child, .chip, .faq-plus { transition: none; }
}
