     $(window).on('hashchange', @checkHash)
 
   resize: ->
-    [width, height] = [$(window).width(), $(window).height()]
-    if width > height
-      min = height
+    [outerWidth, outerHeight] = [$(window).width(), $(window).height()]
+    if outerWidth > @options.ratio * outerHeight
+      min = outerHeight
       paddingV = @options.minPadding
       @$sections.css(
         'font-size':      "#{min * 0.4}%"

        'padding-right': paddingH
      )
      width = @$current.width()
      paddingV = "#{(height - width/@options.ratio)/2}px"
      @$sections.css(
        'padding-top':    paddingV,
        'padding-bottom': paddingV

        'padding-bottom': paddingV
      )
      height = @$current.height()
      width = @options.ratio * height
      paddingH = "#{(outerWidth - width)/2}px"
      @$sections.css(
        'padding-left':  paddingH
        'padding-right': paddingH
      )
    else
      min = outerWidth / @options.ratio
      paddingH = @options.minPadding
      @$sections.css(
        'font-size':      "#{min * 0.4}%"
